package com.ecoolex.cms.system.core.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.ecoolex.cms.system.Constant;
import com.ecoolex.cms.system.core.CoreConstant;
import com.ecoolex.framework.modularize.api.auth.AuthorityRegister;
import com.ecoolex.framework.modularize.api.auth.admin.AdminMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.auth.platform.PlatformMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.auth.user.ConsumerMemberAuthorityManager;
import com.ecoolex.framework.modularize.api.service.config.SystemConfig;

@Profile(CoreConstant.PROJECT_CORE_NAME)
@Configuration
public class CmsSystemCoreInitializer {

	/**
	 * 系统配置注册
	 * @param config
	 */
	@Autowired
	public void registerSystemConfig(SystemConfig config) {
//		config.register(Constant.CONFIG_ENABLE_USER_REGISTER, "true", "启用用户注册页面", Constant.PROJECT_CORE_NAME);
	}

	/**
	 * 权限注册
	 * @param userAuthManager 用户权限管理
	 * @param adminAuthManager 后台权限管理
	 * @param platformAuthManager 平台权限管理
	 */
	@Autowired
	public void registerAuthority(ConsumerMemberAuthorityManager userAuthManager, AdminMemberAuthorityManager adminAuthManager,
			PlatformMemberAuthorityManager platformAuthManager) {
//		AuthorityRegister register = new AuthorityRegister();
//		register.setKey(Constant.AUTH_MODULE_KEY);
//		register.setName(Constant.AUTH_MODULE_NAME);
//		register.setRemark(Constant.AUTH_MODULE_REMARK);
//		
//		userAuthManager.register(register);
//		adminAuthManager.register(register);
//		platformAuthManager.register(register);
	}
}
